package com.lzz.scheduler;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhenzhen
 * @date 2018-12-20 上午10:50
 */
@Component
public class Scheduler2Task {
    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");

    @Scheduled(cron = "0 1 11 * * ?")
    private void reportCurrentTime() {
        System.out.println("current time: " + dateFormat.format(new Date()));
    }
}
